﻿Imports System.IO

Public Class Logger
    Private Shared logFile As String = Path.Combine(TaskInfo.logFilePath, "app.log")

    Public Shared Sub Log(message As String)
        Try
            Dim logMessage As String = $"{DateTime.Now:yyyy-MM-dd HH:mm:ss} - {message}"
            File.AppendAllText(logFile, logMessage & Environment.NewLine)
        Catch ex As Exception
            ' 如果日志写入失败，这里可以忽略或另行处理
        End Try
    End Sub
End Class

